
#include "gtest/gtest.h"

#include "DisjointSet.h"

TEST( DisjointSetTest, Simple )
{
    DisjointSet<int> S( 10 );

    S.Union( 1, 2 ).Union( 3, 4 ).Union( 1, 3 );

    EXPECT_EQ( 1, S.Find( 1 ) );
    EXPECT_EQ( 1, S.Find( 2 ) );
    EXPECT_EQ( 1, S.Find( 3 ) );
    EXPECT_EQ( 1, S.Find( 4 ) );
    EXPECT_EQ( 5, S.Find( 5 ) );
    EXPECT_EQ( 6, S.Find( 6 ) );

}

#include "main_stub.h"

